import request from "@/utils/request";

export function page(data) {
  return request({
    url: "/sys/v1/role/page",
    method: "get",
    params: data
  });
}
export function save(data) {
  return request({
    url: "/sys/v1/role/save",
    method: "post",
    data
  });
}
export function update(data) {
  return request({
    url: "/sys/v1/role/update",
    method: "post",
    data
  });
}

export function deleteId(id) {
  return request({
    url: "/sys/v1/role/delete/" + id,
    method: "get"
  });
}

export function check(id) {
  return request({
    url: "/sys/v1/role/get/" + id,
    method: "get"
  });
}

export function queryall(data) {
  return request({
    url: "/sys/v1/role/queryAll",
    method: "get",
    params:data
  });
}
//校验角色编码唯一
export function checkRoleCode(data) {
  return request({
    url: "/sys/v1/role/checkRoleCode",
    method: "get",
    params:data
  });
}

///v1/sys-user/addSysUserRole
// 给指定角色添加用户

export function addSysUserRole(data) {
  return request({
    url: "/v1/sys-user/addSysUserRole",
    method: "post",
    data
  });
}

//
// 根号用户账号和角色id查用户列表
export function userRoleList(data) {
  return request({
    url: "/v1/sys-user/userRoleList",
    method: "get",
    params:data
  });
}

///v1/sys-user/deleteUserRole删除指定角色的用户关系


export function deleteUserRole(data) {
  return request({
    url: "/v1/sys-user/deleteUserRole",
    method: "delete",
    params:data
  });
}

//批量

export function deleteUserRoleBatch(data) {
  return request({
    url: "/v1/sys-user/deleteUserRoleBatch",
    method: "delete",
    params:data
  });
}


//
// 查询未关联角色用户列表


export function userNotJoinRole(data) {
  return request({
    url: "/v1/sys-user/userNotJoinRole",
    method: "get",
    params:data
  });
}
